<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>
        工作台历列表
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../css/main.css" media="all">
    <script type="text/javascript" src="../../lib/loading/okLoading.js"></script>
    <link rel="stylesheet" href="../../css/bootstrap.css">
    <link rel="stylesheet" href="../../lib/layui/css/layui_2.5.7.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .layui-table-page select {
            height: 22px;
        }
    </style>
</head>

<body>
<div>


    <div class="main_box">
        <div class="panel-heading">
            <h2>电梯信息</h2>
        </div>
    </div>

    <div class="layui-card-body">

        <table class="layui-table" id="test" lay-filter="test">
        </table>
    </div>
    <br><br><br><br><br><br>
</div>
</body>




<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/myAjax.js"></script>
<script type="text/javascript" src="../../js/pub.js"></script>
<script type="text/javascript" src="../../lib/layui/layui2.5.7.js"></script>
<script type="text/javascript" src="../../js/vue.min.js"></script>
<!-- <script src="lib/layui/layui.js" charset="utf-8"></script> -->
<script src="../../js/x-layui.js" charset="utf-8"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>
    layui.use(['laydate', 'element', 'laypage', 'layer', 'form'], function () {
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element;//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层
        var form = layui.form;
        okLoading.close($);
    });
</script>


<script>
    var end = getQueryVariable("end");
    var day = getQueryVariable("day");


    layui.use(['laydate', 'form'],
        function () {
            var laydate = layui.laydate;


        });
    layui.use('table', function () {
        table = layui.table;
        //方法级渲染

        if(end == 1){
            var t1 = table.render({
                elem: '#test',
                url:$baseUrl+ 'maintenance/elevator/unmaintenancelist',
                where: {
                    userId: $userId,
                    day:day,
                },
                headers: {
                    token: $token
                }
                , toolbar: '#toolbarDemo',

                // toolbar: true,
                cols: [
                    [
                        {
                            title: '序号',
                            fixed: 'left',
                            width: '10%',
                            type:'numbers'
                        },

                        {
                            field: 'name',
                            title: '使用单位',
                            templet:function(res){
                                return res.elevator.company.name;
                            }
                        },
                        {
                            field: 'name',
                            title: '项目名称',
                            templet:function(res){
                                return res.elevator.project.name;
                            }
                        },

                        {
                            field: 'address',
                            title: ' 电梯位置',
                            templet:function(res){
                                return res.elevator.address;
                            }

                        },
                        {
                            field: 'usenumber',
                            title: '使用编号',
                            templet:function(res){
                                return res.elevator.usenumber;
                            }

                        },

                        {
                            field: 'recentlymaintenanceDate',
                            title: '最近保养日期',
                            templet:function(res){
                                return res.elevator.recentlymaintenanceDate;
                            }

                        },

                    ]
                ],
                response: {
                    statusName: 'code' //规定数据状态的字段名称，默认：code
                    ,
                    statusCode: 0 //规定成功的状态码，默认：0
                    ,
                    msgName: 'msg' //规定状态信息的字段名称，默认：msg
                    ,
                    countName: 'total' //规定数据总数的字段名称，默认：count
                    ,
                    dataName: 'data', //规定数据列表的字段名称，默认：data
                },
                id: 'test',
                height: 'auto',
                even: true,
                done: function (res, curr, count) {
                    console.log(res);
                    //是否有权限或权限是否失效
                    // authorizeState();
                }
            });

        }
        if(end == 2){

            var t1 = table.render({
                elem: '#test',
                url:$baseUrl+'maintenance/elevator/planmaintenancelist',
                where: {
                    userId: $userId,
                    day:day,
                },
                headers: {
                    token: $token
                }
                , toolbar: '#toolbarDemo',

                // toolbar: true,
                cols: [
                    [
                        {
                            title: '序号',
                            fixed: 'left',
                            width: '10%',
                            type:'numbers'

                        },

                        {
                            field: 'name',
                            title: '使用单位',
                            templet:function(res){
                                return res.elevator.company.name;
                            }
                        },
                        {
                            field: 'name',
                            title: '项目名称',
                            templet:function(res){
                                return res.elevator.project.name;
                            }
                        },

                        {
                            field: 'address',
                            title: ' 电梯位置',
                            templet:function(res){
                                return res.elevator.address;
                            }

                        },
                        {
                            field: 'usenumber',
                            title: '使用编号',
                            templet:function(res){
                                return res.elevator.usenumber;
                            }

                        },

                        {
                            field: 'recentlymaintenanceDate',
                            title: '最近保养日期',
                            templet:function(res){
                                return res.elevator.recentlymaintenanceDate;
                            }

                        },

                    ]
                ],
                response: {
                    statusName: 'code' //规定数据状态的字段名称，默认：code
                    ,
                    statusCode: 0 //规定成功的状态码，默认：0
                    ,
                    msgName: 'msg' //规定状态信息的字段名称，默认：msg
                    ,
                    countName: 'total' //规定数据总数的字段名称，默认：count
                    ,
                    dataName: 'data', //规定数据列表的字段名称，默认：data
                },
                id: 'test',
                height: 'auto',
                even: true,
                done: function (res, curr, count) {
                    console.log(res);
                    //是否有权限或权限是否失效
                    // authorizeState();
                }
            });
        }
        if(end == 3){

            var t1 = table.render({
                elem: '#test',
                url:$baseUrl+'maintenance/elevator/maintenancelist',
                where: {
                    userId: $userId,
                    day:day,
                },
                headers: {
                    token: $token
                }
                , toolbar: '#toolbarDemo',

                // toolbar: true,
                cols: [
                    [
                        {
                            title: '序号',
                            fixed: 'left',
                            width: '10%',
                            type:'numbers'
                        },

                        {
                            field: 'name',
                            title: '使用单位',
                            templet:function(res){
                                return res.elevator.company.name;
                            }
                        },
                        {
                            field: 'name',
                            title: '项目名称',
                            templet:function(res){
                                return res.elevator.project.name;
                            }
                        },

                        {
                            field: 'address',
                            title: ' 电梯位置',
                            templet:function(res){
                                return res.elevator.address;
                            }

                        },
                        {
                            field: 'usenumber',
                            title: '使用编号',
                            templet:function(res){
                                return res.elevator.usenumber;
                            }

                        },

                        {
                            field: 'recentlymaintenanceDate',
                            title: '最近保养日期',
                            templet:function(res){
                                return res.elevator.recentlymaintenanceDate;
                            }

                        },

                    ]
                ],
                response: {
                    statusName: 'code' //规定数据状态的字段名称，默认：code
                    ,
                    statusCode: 0 //规定成功的状态码，默认：0
                    ,
                    msgName: 'msg' //规定状态信息的字段名称，默认：msg
                    ,
                    countName: 'total' //规定数据总数的字段名称，默认：count
                    ,
                    dataName: 'data', //规定数据列表的字段名称，默认：data
                },
                id: 'test',
                height: 'auto',
                even: true,
                done: function (res, curr, count) {
                    console.log(res);
                    //是否有权限或权限是否失效
                    // authorizeState();
                }
            });
        }
        if(end == 4){

            var t1 = table.render({
                elem: '#test',
                url:$baseUrl+'maintenance/elevator/repairlist',
                where: {
                    userId: $userId,
                    day:day,
                },
                headers: {
                    token: $token
                }
                , toolbar: '#toolbarDemo',

                // toolbar: true,
                cols: [
                    [
                        {
                            title: '序号',
                            fixed: 'left',
                            width: '10%',
                            type:'numbers'
                        },

                        {
                            field: 'name',
                            title: '使用单位',
                            templet:function(res){
                                return res.elevator.company.name;
                            }
                        },
                        {
                            field: 'name',
                            title: '项目名称',
                            templet:function(res){
                                return res.elevator.project.name;
                            }
                        },

                        {
                            field: 'address',
                            title: ' 电梯位置',
                            templet:function(res){
                                return res.elevator.address;
                            }

                        },
                        {
                            field: 'usenumber',
                            title: '使用编号',
                            templet:function(res){
                                return res.elevator.usenumber;
                            }

                        },

                        {
                            field: 'recentlymaintenanceDate',
                            title: '最近保养日期',
                            templet:function(res){
                                return res.elevator.recentlymaintenanceDate;
                            }

                        },

                    ]
                ],

                response: {
                    statusName: 'code' //规定数据状态的字段名称，默认：code
                    ,
                    statusCode: 0 //规定成功的状态码，默认：0
                    ,
                    msgName: 'msg' //规定状态信息的字段名称，默认：msg
                    ,
                    countName: 'total' //规定数据总数的字段名称，默认：count
                    ,
                    dataName: 'data', //规定数据列表的字段名称，默认：data
                },
                id: 'test',
                height: 'auto',
                even: true,
                done: function (res, curr, count) {
                    console.log(res);
                    //是否有权限或权限是否失效
                    // authorizeState();
                }
            });
        }

    });



    function admin_add(title, url, w, h) {
        x_admin_show(title, url, w, h);
    }
</script>




</html>
